package lpg;

class BlockSymbol extends Symbol
{
    BlockSymbol(String name, int poolIndex)
    {
        super(name, poolIndex);
    }

    String blockBegin()
    {
        return name;
    }

    void setKind(Kind kind)
    {
        this.kind = kind;
    }

    Kind kind()
    {
        return kind;
    }

    void setBlockEnd(String blockEnd)
    {
        this.blockEnd = blockEnd;
    }

    String blockEnd()
    {
        return blockEnd;
    }

    void setActionFileSymbol(ActionFileSymbol fileNameSymbol)
    {
        this.fileNameSymbol = fileNameSymbol;
    }

    ActionFileSymbol actionFileSymbol()
    {
        return fileNameSymbol;
    }

    void setBuffer(StringBuilder buffer)
    {
        this.buffer = buffer;
    }

    StringBuilder buffer()
    {
        return buffer;
    }

    private Kind kind = null;
    private String blockEnd = null;
    private StringBuilder buffer = null;
    private ActionFileSymbol fileNameSymbol = null;

    static enum Kind
    {
        MAIN_BLOCK(OptionEnum.ACTION_BLOCK),
        HEADER_BLOCK(OptionEnum.HEADERS),
        TRAILER_BLOCK(OptionEnum.TRAILERS);

        Kind(OptionEnum option)
        {
            this.option = option;
        }

        final OptionEnum option;
    }

}
